package org.smr.ministore.micro.client;

import java.util.List;
import java.util.Map;

import org.blade.utils.Pager;
import org.smr.ministore.entities.GoodsPrice;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient("gateway.GoodsPrice")
public interface FeignGoodsPriceMicroServiceClient {

    @RequestMapping(method = RequestMethod.PUT, value = "/GoodsPrice/batchSave")
    int batchSave(@RequestBody List< GoodsPrice> entities);

    @RequestMapping(method = RequestMethod.POST, value = "/GoodsPrice/batchModify")
    int batchModify(@RequestBody List< GoodsPrice> entities);

    @RequestMapping(method = RequestMethod.PUT, value = "/GoodsPrice/save")
    public int save(@RequestBody GoodsPrice entity) ;

    @RequestMapping(method = RequestMethod.PATCH, value = "/GoodsPrice/updateById")
    public int updateById(@RequestBody GoodsPrice id);

    @RequestMapping(method = RequestMethod.GET, value = "/GoodsPrice/queryById/{id}")
    public  GoodsPrice queryById(@PathVariable("id")Long id);

    @RequestMapping(method = RequestMethod.DELETE, value = "/GoodsPrice/deleteById/{id}")
    public int deleteById(@PathVariable("id")Long id);

    @RequestMapping(method = RequestMethod.POST, value = "/GoodsPrice/paginate")
    public Pager<GoodsPrice> paginate( @RequestBody GoodsPrice entity, Long pageSize, Long pageNum);

    @RequestMapping( method = RequestMethod.POST, value = "/GoodsPrice/getGoodsPriceList/{pageSize}/{pageNum}")
    public List<Map<String, Object>> getGoodsPriceList(@RequestBody Map<String, Object> params,
                                                       @PathVariable("pageSize") Long pageSize,
                                                       @PathVariable("pageNum") Long pageNum);

    @ResponseBody
    @RequestMapping( method = RequestMethod.POST, value = "/GoodsPrice/getGoodsPriceBy/{organId}/{goodsId}")
    public GoodsPrice getGoodsPriceBy(@PathVariable("organId")Long organId,
                                      @PathVariable("goodsId")Long goodsId);
}
